﻿#ifndef WIDGET_H
#define WIDGET_H
 
#include <QWidget>
#include <QPainter>
#include <QMouseEvent>
#include <QMovie>
#include <QSystemTrayIcon>
#include <QAction>
#include <QMenu>
#include <QStringList>
 
class Widget : public QWidget
{
    Q_OBJECT
 
public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

protected:
	void mouseMoveEvent(QMouseEvent *event) override;
	void mousePressEvent(QMouseEvent *event) override;
	void mouseReleaseEvent(QMouseEvent *event) override;
	void closeEvent(QCloseEvent *event) override;

private slots:
	void iconActivated(QSystemTrayIcon::ActivationReason reason);
	void nextGif();
	void FlashGif();
 
private:
    bool dragging;	//是否正在拖动
    QPoint startPosition; //拖动开始前的鼠标位置
    QPoint framePosition;	//窗体的原始位置

	QAction *flashAction;
	QAction *nextAction;
	QAction *quitAction;

	QSystemTrayIcon *trayIcon;
	QMenu *trayIconMenu;
	QMovie* movie;
	QStringList gifs;
};
 
#endif // WIDGET_H
